package action.impl;

import java.util.UUID;

import pojo.Merchant;
import service.MerchantManager;
import service.factory.ManagerFactory;
import util.Base64Util;
import action.Action;
import dto.Protocol;

public class MessageAction implements Action{
	
	private MerchantManager manager;
	
	private static String dirPath = "D:\\bin\\apache-tomcat-7.0.79\\webapps\\";
	
	public MessageAction(){
		manager = ManagerFactory.getMerchantManagerInstance();
	}
	
	

	@Override
	public void action(Protocol protocol) {
		String imageName = UUID.randomUUID().toString();
		String path = dirPath+imageName+".jpg";
		Base64Util.parseBase64(protocol.getAvatar(), dirPath, "jpg");
		Merchant merchant = new Merchant(null,protocol.getName(),protocol.getIdCard(),path,protocol.getAddress(),Merchant.WAIT_AUDIT);
		
	}

}
